<li><div class="news-list-wrapper" data-type="bid"><div class="news-list-inner"><div>
<div id="status">
  <div><div class="profile-pic-wrapper">
  <span class="profile-pic"> 
    <a href="/u/qualifiedcoders.html">
      <img src="http://cdn6.f-cdn.com/ppic/1577262/logo/355927/profile_logo_355927.jpg" width="32" height="32" alt="profile pic" title="qualifiedcoders" class="profile-pic"> 
    </a>
    <i></i> 
    </span>
</div>

</div>
  <h2> 
    <?php if(count($data->bidjobs) == 1): ?>
    <?php 
          $job = array_pop($data->bidjobs);
      ?>
      <h2> 
      <a class="font-bold" id="username1st" href="<?php echo Yii::app()->createUrl('/user/',array('id'=>$value->user->id)) ?>" ><?php echo $job->user->name; ?></a>
      đã đăng ký tham gia dự án
 <a class="trunc" href="<?php echo Yii::app()->createUrl('/job/create/view',array('id'=>$job->job->id)); ?>" style="color: #006898;"><?php echo $job->job->name; ?></a> </h2>
  <?php else: ?>
  <h2> 
    <?php $enduser = array_pop($data->bidjobs); ?>
    <a class="font-bold" id="username1st" href="#" ><?php echo $enduser->user->name; ?></a>
    <span id="numOfOthers"> 
      <?php $count = count($data->bidjobs) -1; ?>
      và <a id="others" href="" style="color: #006898;"><?php echo "$count người khác"; ?></a></span> 
      đã đăng ký thầu dự án  <a class="trunc" href="<?php echo Yii::app()->createUrl('/job/create/view',array('id'=>$enduser->job->id)); ?>" style="color: #006898;"><?php echo $enduser->job->name; ?></a> 
      <em class="timestamp time_text">
        <?php echo Yii::app()->getModule('job')->time_diff_all($enduser->timepost,date("Y-m-d H:i:s"))." trước đó"; ?>
      </em></h2>
      <div>
      <div class="btn-group news-actions">
    <a class="btn dropdown-toggle" data-toggle="dropdown"><i class="icon-list icon-grey"></i></a>
    <ul class="dropdown-menu">
        <li><a class="hide">Hide this item</a></li>
    <li></li>
    </ul>
    <a class="btn dropdown-toggle pin" rel="tooltip" title="Star this item"><i class="icon-star icon-grey"></i></a>
    <?php endif; ?>
    
</div></div>
</div>

  <div id="content">
<!--     <span id="formatNotification"></span> -->
    <ul class="news-list news-list-avatar news-list-ratings">
      <?php foreach($data->bidjobs as $value): ?>
      <div>
        <li data-time="1358325999" class="news-item">
            <div>
              <div class="profile-pic-wrapper">
                <span class="profile-pic"> 
                  <a href="/u/rajat07me.html">
                    <img src="http://cdn3.f-cdn.com/ppic/2016424/logo/1609677/profile_logo_1609677.jpg" width="32" height="32" alt="profile pic" title="rajat07me" class="profile-pic"> 
                    </a>
                 <i></i> 
    </span>
</div>
</div>
  <h3> 
     <a id="username" class="font-bold" href="<?php echo Yii::app()->createUrl('/user/',array('id'=>$value->user->id)) ?>"><?php echo $value->user->name; ?></a> đấu giá <strong> <?php echo $value->money.'/'.$value->job->budget->currency->currency.'/'.$value->timeduration; ?></strong> 

  <em class="timestamp time_text" style="color: #999;">
    <?php echo Yii::app()->getModule('job')->time_diff_all($value->timepost,date("Y-m-d H:i:s"))." trước đó"; ?>
  </em>
  </h3>
  <div class="descr-long" style="word-wrap: break-word;">
    <p id="needToShorten" data-origin="" style="">
      <?php echo $value->desc; ?> </p></div>
  
  <dl class="quick-stats">
    <dt class="access stats-ratings">
      Feedback rating out of 5 stars
    </dt>
    <dd class="stats-ratings" title="Rating for related skills">
      <span></span>
      4.8
    </dd>
    <dt class="access stats-earnings">
      Earnings rating out of 10 for completing similar projects
    </dt>
    <dd class="stats-earnings" title="Earnings for related skills">
      <span></span>
      7.3
    </dd>
    <dt class="access stats-messages">
      Private messages between you and Freelancer
    </dt>
    <dd class="stats-messages last" title="Reviews for related skills">
      <span></span>
      518
    </dd>
  </dl>

  <!-- awarded case alert bar-->
  <div class="alert alert-success" id="action_history" style=" display: none ">
    <div class="actions tabbable">
      <ul class="nav nav-tabs">
        
        
      </ul>
    </div>
  </div>
  <!-- not awarded case -->
  <div class="actions tabbable">
    <ul class="nav nav-tabs">
      <li class="first" id="award-project">
        <a id="<?php echo "award".$value->id; ?>" class="sendinfo"> <i class="icon-share-alt" ></i>&nbsp;Chấp nhận dự án</a>
      </li>
      <li class="last" id="send-message">
        <a id="messaging" class ="sendinfo"> <i class="icon-share-alt"></i>&nbsp;Send Message</a>
      </li>
    </ul>
  </div>
  <!-- confimation box -->
  <div class="tab-content" id="<?php echo 'award_box'.$value->id; ?>">
    <div class="tab-pane active">
      <div id="<?php echo 'award-well'.$value->id; ?>" class="well" style="display:none; ">
        <p id="confirmation-message">
          Bạn có muốn <strong><?php echo $value->user->name; ?></strong> tham gia dự án của bạn không?
        </p>
        <div class="form-btn-wrapper">
          <?php 
         echo CHtml::button("Đồng ý",array(
                    'class'=> 'btn btn-primary submit',
                    'id'=>'submit',
                    'onclick'=>CHtml::ajax(array(
                                'url'=>Yii::app()->createUrl('/job/create/accept',array('id'=>md5($value->job->name))), 
                                'update'=>'#award_box'.$value->id,
                                ))
                    )
                              );
           ?>
          <a class="btn cancel" id="<?php echo "cancel".$value->id; ?>">Không đồng ý</a>
        </div>
        <span class="hint error-msg" style="display: none; "></span>
      </div>
    </div>
  </div>
  <script type="text/javascript">
  $("<?php echo '#award'.$value->id; ?>").click(function () {
    $("<?php echo '#award-well'.$value->id; ?>").show();
  });
  $("<?php echo '#cancel'.$value->id; ?>").click(function () {
    $("<?php echo '#award-well'.$value->id; ?>").hide();
  });
</script>
</li></div>
    <?php endforeach; ?>
    <li id="pageBar" class="view-all last" style="">
        <a id="viewAll"><i class="icon-plus-sign"></i><span>&nbsp;View all</span></a>
        <div id="scrollBar" style="">
          <a id="scrollUp"><i class="icon-plus-sign"></i>&nbsp;View more bids</a>
          <span id="scrollStatus" style="margin-right:15px; margin-top: -20px; float:right"></span>
        </div>
      </li>
    </ul>
  </div>